package com.echo.acc.service.img;

import com.echo.acc.dao.UsersMapper;
import com.echo.acc.pojo.Users;
import com.echo.acc.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author echo
 * @date 2023-12-22 10:14:31
 */
@Service
public class UsersServiceImpl implements UsersService {

    @Autowired
    private UsersMapper usersMapper;

    @Override
    public Users login(Users users) {
        Users usersDo = usersMapper.selectByUsernameAndPassword(users.getUsername(), users.getPassword());

        if(usersDo == null) {
            throw new RuntimeException("用户名或密码错误");
        }

        return usersDo;
    }
}
